<template>
	<view class="video-player-page">
		<!-- 页面头部 -->
		<view class="page-header">
			<view class="header-left" @click="goBack">
				<u-icon name="arrow-left" color="#ffffff" size="42"></u-icon>
			</view>
			<view class="header-title">视频播放</view>
			<view class="header-right"></view>
		</view>
		
		<!-- 视频播放器 -->
		<view class="video-container">
			<video 
				:src="videoUrl" 
				class="video-player"
				controls
				autoplay
				show-center-play-btn
				show-play-btn
				show-fullscreen-btn
				show-progress
				enable-progress-gesture
				object-fit="contain"
			></video>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				videoUrl: ''
			}
		},
		onLoad(options) {
			if (options.url) {
				this.videoUrl = decodeURIComponent(options.url);
			}
		},
		methods: {
			// 返回上一页
			goBack() {
				uni.navigateBack();
			}
		}
	}
</script>

<style scoped>
	.video-player-page {
		min-height: 100vh;
		background-color: #000000;
		position: relative;
	}
	
	/* 页面头部 */
	.page-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 20rpx 30rpx;
		background-color: rgba(0, 0, 0, 0.8);
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 100;
	}
	
	.header-left, .header-right {
		width: 80rpx;
		display: flex;
		align-items: center;
	}
	
	.header-title {
		font-size: 36rpx;
		font-weight: bold;
		color: #ffffff;
	}
	
	/* 视频容器 */
	.video-container {
		width: 100%;
		height: 100vh;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: #000000;
	}
	
	.video-player {
		width: 100%;
		height: 100%;
	}
</style> 